package com.netease.nie.dao;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Repository;

import com.netease.nie.base.exceptions.BusinessException;
import com.netease.nie.constants.BusinessConstants;
import com.netease.nie.mapper.ExchangeGoodsInfoExtendMapper;
import com.netease.nie.model.ExchangeGoodsInfoExtend;

@Repository
public class ExchangeGoodsInfoExtendDao {

	@Resource
	private ExchangeGoodsInfoExtendMapper exchangeGoodsInfoExtendMapper;
	
	public ExchangeGoodsInfoExtend queryGoodsInfoExtendById(int id) {
		ExchangeGoodsInfoExtend exchangeGoodsInfoExtend = exchangeGoodsInfoExtendMapper.queryGoodsInfoExtendById(id);
		if (exchangeGoodsInfoExtend == null)
			throw new BusinessException(BusinessConstants.GOODS_NOT_EXISTS.getCode(), BusinessConstants.GOODS_NOT_EXISTS.getMsg());
		return exchangeGoodsInfoExtend;
	}
	
	public List<ExchangeGoodsInfoExtend> queryGoodsInfoExtendByIds(List<Integer> ids) {
		return exchangeGoodsInfoExtendMapper.queryGoodsInfoExtendByIds(ids);
	}
}
